﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Converter
{
    class Binary
    {
        public string BinaryToDecimal(string[] sArr)
        {
            string sResult = string.Empty;
            foreach (string sVal in sArr)
            {
                if (sResult == string.Empty)
                    sResult = Convert.ToString(Convert.ToInt64(sVal, 2));
                else
                    sResult = sResult + " " + Convert.ToString(Convert.ToInt64(sVal, 2));
            }
            return sResult;
        }

        public string BinaryToHex(string[] sArr)
        {
            string sResult = string.Empty;
            foreach (string sVal in sArr)
            {
                if (sResult == string.Empty)
                    sResult = Convert.ToString(Convert.ToInt64(sVal, 16)).PadLeft(2, '0');
                else
                    sResult = sResult + " " + Convert.ToString(Convert.ToInt64(sVal, 16)).PadLeft(2, '0');
            }
            return sResult;
        }

        public string BinaryToExtAscii(string[] sArr)
        {
            string sResult = string.Empty;
            return sResult;
        }
    }
}
